package com.kmzx.one.project.mapper;

import com.kmzx.one.project.entity.WxUser;
import com.kmzx.one.project.others.dso.OrderBeSendDso;
import com.kmzx.one.project.others.dso.RankUserDso;
import com.kmzx.one.project.others.dso.UserFansDso;
import com.kmzx.one.project.others.dto.UserCenterInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Mapper
@Repository
public interface WxUserMapper {
    WxUser selectById(@Param("id") String id);

    WxUser selectByOpenId(@Param("openId") String openId);

    List<RankUserDso> selectUserRankTabNo();

    int insertWxUser(@Param("wxUser") WxUser wxUser);

    Integer doUpdateWxUser(WxUser wxUser);

    UserCenterInfo selectUserTopInfo(@Param("userId") String userId);

    List<UserFansDso> selectUserL1Fans(@Param("userId") String userId);

    List<UserFansDso> selectUserAllFans(@Param("list") List<String> list);

    List<OrderBeSendDso> selectUserTwoInfo(@Param("userId") String userId);

    int countOldFans(@Param("userId") String userId);

    int hasTop(@Param("userId") String userId);

    void updateUserInfo(@Param("userId") String userId, @Param("nickName") String nickName, @Param("avatar") String avatar, @Param("updateTime") Date updateTime);

    void updateUserUnionId(@Param("userId") String userId,
                           @Param("nickName") String nickName,
                           @Param("avatar") String avatar,
                           @Param("unionId") String unionId, @Param("updateTime") Date updateTime);
}
